<div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url('admini')?>">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">用户管理</span></div>
        </div> 
        <div class="search-wrap">
            <div class="search-content">
                <form action="<?=site_url('admini/user/index')?>" method="get">
                    <table class="search-tab">
                        <tr>
                            <th width="120">搜索方式:</th>
                            <td>
                                <select id="" name="tmp">
                                    <option value="1">用户名</option>
                                    <option value="2">邮箱</option>
                                    <option value="3">昵称</option>
                                </select>
                            </td>
                            <th width="70">关键字:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div> 
        <div class="result-wrap">
        		<div class="result-title">
                    <div class="result-list">
                        <a href="<?=site_url('admini/user/create')?>"><i class="icon-font"></i>新增用户</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th>编号</th>
                            <th>用户名</th>
                            <th>昵称</th>
                            <th>邮箱</th>
                            <th>最后登陆时间</th>
                            <th>创建时间</th>
                            <th>状态</th>
                        </tr>
                        <?php foreach($list as $k => $v): ?>
                        <?php if($v['group'] == 0):?>
                        <tr style="color: red">
                        <?php else:?>
                        <tr>
                        <?php endif;?>
                        	<td><?=$v['id']?></td>
                        	<td><?=$v['username'] ?></td>
                        	<td><?= $v['nickname'] ?></td>
                        	<td><?=$v['mail']?></td>
                        	<td><?php if(!empty($v['login_time'])) echo date("Y-m-d H:i:s",$v['login_time']); ?></td>
                        	<td><?=date('Y-m-d H:i:s',$v['create_time'])?></td>
                        	<td>
                        		<select name="status" onchange="update(this.value,<?=$v['id']?>)">
                        			<option value="2">启用</option>
                        			<option value="0" <?=$v['group'] == 0 ? 'selected' : ''?>>禁用</option>
                        		</select>
                        	</td>
                        </tr>
                        <?php endforeach; ?>
                    </table>
                    <div class="list-page"><?=$page?></div>
                </div>
        </div>
        <script>
        	function update(res,uid){
        		$.post("<?=site_url('admini/user/edit_sta')?>",{uid:uid,status:res},function(data){
        			if(data == 1){
		                layer.alert('修改用户状态成功！',{
		                    icon:1,
		                },function(){
		                    location.reload(true);
		                });
		            }else{
		                layer.alert(data,{
		                    icon:2,
		                });
		            }
        		});
        	}
        	
        </script>